package com.gitee.chili.leisure.api.innings;

import com.gitee.chili.leisure.ResponseResult;
import com.gitee.chili.leisure.annotation.PathRestController;
import com.gitee.chili.leisure.domain.Innings;
import com.gitee.chili.leisure.service.IInningsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * InningsController
 *
 * @author week solider
 * @since 2020.09.08
 */
@Validated
@PathRestController("/innings")
public class InningsController {

    @Autowired
    private IInningsService inningsService;


    @PostMapping("/all")
    public ResponseResult<List<Innings>> inningsAll() {
        List<Innings> all = inningsService.findAll();
        return ResponseResult.success(all);
    }
}
